﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Serialization;

namespace Nsf.Samples.RetryActivitySample.Service.Configuration
{
    public class WorkflowTypesSectionHandler : IConfigurationSectionHandler
    {
        #region IConfigurationSectionHandler Members

        public object Create(object parent, object configContext, XmlNode section)
        {
            var serializer = new XmlSerializer(typeof(WorkflowTypes));
            using (var sr = new StringReader(section.OuterXml))
            {
                return serializer.Deserialize(sr);
            }
        }

        #endregion
    }
}
